<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>Plane.h</h1><a href="Plane_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         Plane.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        Plane</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     Independent</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Struct to hold a plane with some convenient</span>
00014 <span class="comment">               constructors/functions/operators. Eqaution of plane is Ax+By+Cz+D=0</span>
00015 <span class="comment"></span>
00016 <span class="comment">******************************************************************************/</span>
00017 
00018 <span class="preprocessor">#ifndef PLANE_H</span>
00019 <span class="preprocessor"></span><span class="preprocessor">#define PLANE_H</span>
00020 <span class="preprocessor"></span>
00021 <span class="comment">/******************************************************************************</span>
00022 <span class="comment">Includes</span>
00023 <span class="comment">******************************************************************************/</span>
00024 
00025 <span class="preprocessor">#include "PVRTools.h"</span>
00026 
00027 <span class="keyword">namespace </span>pvrengine
00028 {
00029     <span class="comment">/*!****************************************************************************</span>
00030 <span class="comment">    Struct</span>
00031 <span class="comment">    ******************************************************************************/</span>
00032     <span class="comment">/*!***************************************************************************</span>
00033 <span class="comment">    * @Struct Plane</span>
00034 <span class="comment">    * @Brief Struct to hold a plane</span>
00035 <span class="comment">    * @Description Struct to hold a plane</span>
00036 <span class="comment">    *****************************************************************************/</span>
00037     <span class="keyword">struct </span>Plane
00038     {
00039         VERTTYPE    <a class="code" href="structpvrengine_1_1Plane.html#o0">fA</a>,<a class="code" href="structpvrengine_1_1Plane.html#o1">fB</a>,<a class="code" href="structpvrengine_1_1Plane.html#o2">fC</a>,<a class="code" href="structpvrengine_1_1Plane.html#o3">fD</a>;    
00041         <span class="comment">/*!***************************************************************************</span>
<a name="l00042"></a><a class="code" href="structpvrengine_1_1Plane.html">00042</a> <span class="comment">        @Function           Plane</span>
00043 <span class="comment">        @Description        blank constructor.</span>
<a name="l00044"></a><a class="code" href="structpvrengine_1_1Plane.html#o3">00044</a> <span class="comment">        *****************************************************************************/</span>
00045         <a class="code" href="structpvrengine_1_1Plane.html#a0">Plane</a>(){}
00046 
00047         <span class="comment">/*!***************************************************************************</span>
00048 <span class="comment">        @Function           Plane</span>
00049 <span class="comment">        @Input              A   coefficient value</span>
00050 <span class="comment">        @Input              B   coefficient value</span>
<a name="l00051"></a><a class="code" href="structpvrengine_1_1Plane.html#a0">00051</a> <span class="comment">        @Input              C   coefficient value</span>
00052 <span class="comment">        @Input              D   coefficient value</span>
00053 <span class="comment">        @Description        basic constructor to initialise a Plane object directly</span>
00054 <span class="comment">        from equation coefficients.</span>
00055 <span class="comment">        *****************************************************************************/</span>
00056         <a class="code" href="structpvrengine_1_1Plane.html#a0">Plane</a>(<span class="keyword">const</span> VERTTYPE A, <span class="keyword">const</span> VERTTYPE B, <span class="keyword">const</span> VERTTYPE C, <span class="keyword">const</span> VERTTYPE D)
00057         {   <a class="code" href="structpvrengine_1_1Plane.html#o0">fA</a> = A; <a class="code" href="structpvrengine_1_1Plane.html#o1">fB</a> = B; <a class="code" href="structpvrengine_1_1Plane.html#o2">fC</a> = C; <a class="code" href="structpvrengine_1_1Plane.html#o3">fD</a> = D;}
00058 
00059         <span class="comment">/*!***************************************************************************</span>
00060 <span class="comment">        @Function           Plane</span>
00061 <span class="comment">        @Input              A   coefficient value</span>
00062 <span class="comment">        @Input              B   coefficient value</span>
<a name="l00063"></a><a class="code" href="structpvrengine_1_1Plane.html#a1">00063</a> <span class="comment">        @Input              C   coefficient value</span>
00064 <span class="comment">        @Description        constructor to initialise a Plane object from 3 points</span>
00065 <span class="comment">        *****************************************************************************/</span>
00066         <a class="code" href="structpvrengine_1_1Plane.html#a0">Plane</a>(<span class="keyword">const</span> PVRTVec3&amp; A,<span class="keyword">const</span> PVRTVec3&amp; B,<span class="keyword">const</span> PVRTVec3&amp; C);
00067 
00068         <span class="comment">/*!***************************************************************************</span>
00069 <span class="comment">        @Function           normalize</span>
00070 <span class="comment">        @Description        normalizes the associated normal to the plane</span>
00071 <span class="comment">        essential for the accuracy of some calculations.</span>
00072 <span class="comment">        *****************************************************************************/</span>
00073         <span class="keywordtype">void</span> <a class="code" href="structpvrengine_1_1Plane.html#a3">normalize</a>();
00074 
00075         <span class="comment">/*!***************************************************************************</span>
00076 <span class="comment">        @Function           getNormal</span>
00077 <span class="comment">        @Return             A PVRTVec3 containing the normal</span>
00078 <span class="comment">        @Description        Retrieves the normal vector associated with this plane object.</span>
00079 <span class="comment">        *****************************************************************************/</span>
00080         PVRTVec3 <a class="code" href="structpvrengine_1_1Plane.html#a4">getNormal</a>()<span class="keyword"> const</span>
00081 <span class="keyword">        </span>{   <span class="keywordflow">return</span> PVRTVec3(fA,fB,fC);  }
00082 
00083         <span class="comment">/*!***************************************************************************</span>
00084 <span class="comment">        @Function           whichSideIs</span>
00085 <span class="comment">        @Input              vPoint  the point in question</span>
00086 <span class="comment">        @Return         value indicating the relative position of the</span>
00087 <span class="comment">        point to the plane</span>
00088 <span class="comment">        @Description        returns a value from which it may be determined which</span>
00089 <span class="comment">        side of the plane the passed point is on negative vs positive. if 0 is</span>
<a name="l00090"></a><a class="code" href="structpvrengine_1_1Plane.html#a4">00090</a> <span class="comment">        returned then the point is on the plane. It is probably wise to normalize</span>
00091 <span class="comment">        the plane first.</span>
00092 <span class="comment">        *****************************************************************************/</span>
00093         VERTTYPE <a class="code" href="structpvrengine_1_1Plane.html#a5">whichSideIs</a>(<span class="keyword">const</span> PVRTVec3&amp; vPoint) <span class="keyword">const</span>;
00094 
00095     };
00096 
00097 }
00098 
00099 <span class="preprocessor">#endif // PLANE_H</span>
00100 <span class="preprocessor"></span>
00101 <span class="comment">/******************************************************************************</span>
00102 <span class="comment">End of file (Plane.h)</span>
00103 <span class="comment">******************************************************************************/</span>
00104 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
